FROM php:8-fpm-bullseye

ADD ./install-php-extensions /usr/local/bin/

RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
    apt update && \
    apt install -y net-tools && \
    apt install -y iputils-ping && \
    apt install -y telnet && \
    apt install -y less && \
    apt install -y vim && \
    apt install -y wget

#RUN cd /opt && \
#    wget https://nodejs.org/dist/v16.16.0/node-v16.16.0-linux-x64.tar.xz && \
#    tar xf node-v16.16.0-linux-x64.tar.xz && \
#    echo 'export PATH=/opt/node-v16.16.0-linux-x64/bin:$PATH' >> /root/.bashrc && \
#    export PATH=/opt/node-v16.16.0-linux-x64/bin:$PATH && \
#    npm config set registry https://registry.npm.taobao.org

RUN chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions @composer && \
    composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ && \
    composer global require laravel/installer && \
    echo 'export PATH=/root/.composer/vendor/bin:$PATH' >> /root/.bashrc && \
    install-php-extensions pdo_pgsql && \
    install-php-extensions bcmath && \
    IPE_GD_WITHOUTAVIF=1 install-php-extensions gd && \
    install-php-extensions mysqli && \
    install-php-extensions pdo_mysql && \
    install-php-extensions zip && \
    install-php-extensions pcntl
    #install-php-extensions xdebug
    #install-php-extensions redis
